package com.bluedot.www.core.common;


/**
 * 枚举类，封装请求状态信息
 *
 * @author Jiutwo
 * @version 1.0
 * @date 2021/6/7 12:54
 */
public enum ResultCodeEnum {
    /**
     * 成功状态
     */
    SUCCESS(true, 20000, "成功"),
    /**
     * 出现未知错误
     */
    UNKNOWN_ERROR(false, 20001, "未知错误"),
    /**
     * 参数错误
     */
    PARAM_ERROR(false, 20002, "参数错误"),
    /**
     * 空指针错误
     */
    NULL_POINT(false, 20003, "空指针异常"),
    /**
     * 客户端异常
     */
    HTTP_CLIENT_ERROR(false, 20004, "客户端异常"),
    /**
     * 方法不存在异常
     */
    METHOD_NOT_FOUND(false, 20005, "方法不存在"),
    /**
     * 类不存在异常
     */
    CLASS_NOT_FOUND(false, 20006, "类不存在");

    /**
     * 响应是否成功
     */
    private final Boolean success;
    /**
     * 响应状态码
     */
    private final Integer code;
    /**
     * 响应信息
     */
    private final String message;

    ResultCodeEnum(boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


}
